using UnityEngine;
using System.Collections;

public class DeconstructionJob : Job {
	
	public DeconstructionJob(int nstartX, int nstartY, int nstartZ):base(nstartX, nstartY, nstartZ, 3){
		
	}
	
	public bool workOn(double workspeed, Robot robot){
		bool isDone = base.workOn(workspeed, robot);
		double amount = workspeed * (robot.rateOfDeconstruction);
		percentageComplete += amount;
		
		foreach (Tool t in robot.deconstructionTools){
			t.wearPercent += 0.001/t.material.strengthModifier;
			if (t.wearPercent > 100){
				robot.tools.Remove(t);
				robot.deconstructionTools.Remove(t);
				robot.hasDeconstructionTool = false;
			}
		}
		return isDone;
	}
	
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}
